Skip to content

feat(deno): add hapi integration#22462

Open
isaacs wants to merge 1 commit into
isaacs/deno-orchestrion-integrations-expressfrom
isaacs/deno-orchestrion-integrations-hapi
Open

feat(deno): add hapi integration#22462
isaacs wants to merge 1 commit into
isaacs/deno-orchestrion-integrations-expressfrom
isaacs/deno-orchestrion-integrations-hapi

Conversation

@isaacs

@isaacs isaacs commented Jul 21, 2026

Copy link
Copy Markdown
Member

No description provided.

@isaacs
isaacs requested a review from a team as a code owner July 21, 2026 19:40
@isaacs
isaacs requested review from JPeer264 and andreiborza and removed request for a team July 21, 2026 19:40
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-hapi branch from 6b79404 to 519f13a Compare July 21, 2026 19:49
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-express branch from 6237ccf to 4c157ad Compare July 21, 2026 19:49
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-hapi branch from 519f13a to 4298281 Compare July 21, 2026 21:43
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-express branch from 4c157ad to 86ed574 Compare July 21, 2026 21:43
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-hapi branch from 4298281 to 37ffb67 Compare July 22, 2026 00:51
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-express branch from 86ed574 to 55f7640 Compare July 22, 2026 00:51
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-hapi branch from 37ffb67 to 0460096 Compare July 22, 2026 14:42
@isaacs
isaacs requested review from a team as code owners July 22, 2026 14:42
@isaacs
isaacs requested review from chargome, msonnb and mydea and removed request for a team July 22, 2026 14:42
@isaacs
isaacs force-pushed the isaacs/deno-orchestrion-integrations-express branch from 55f7640 to 8d4883f Compare July 22, 2026 14:42
Comment on lines +18 to +55
/** See deno-redis.test.ts — same sink shape, deduped for clarity. */
function transactionSink(): {
beforeSendTransaction: (event: TransactionEvent) => null;
waitFor: (predicate: (event: TransactionEvent) => boolean) => Promise<TransactionEvent>;
} {
const transactions: TransactionEvent[] = [];
const waiters: { predicate: (e: TransactionEvent) => boolean; resolve: (e: TransactionEvent) => void }[] = [];
return {
beforeSendTransaction(event) {
transactions.push(event);
for (let i = waiters.length - 1; i >= 0; i--) {
const w = waiters[i]!;
if (w.predicate(event)) {
waiters.splice(i, 1);
w.resolve(event);
}
}
return null;
},
waitFor(predicate) {
const already = transactions.find(predicate);
if (already) return Promise.resolve(already);
return new Promise<TransactionEvent>(resolve => {
waiters.push({ predicate, resolve });
});
},
};
}

function withTimeout<T>(p: Promise<T>, ms: number, what: string): Promise<T> {
let timer: ReturnType<typeof setTimeout> | undefined;
const timeout = new Promise<T>((_, reject) => {
timer = setTimeout(() => reject(new Error(`Timed out waiting for ${what} after ${ms}ms`)), ms);
});
return Promise.race([p, timeout]).finally(() => {
if (timer !== undefined) clearTimeout(timer);
});
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Are these useful for other integrations? Maybe we can extract them into test helpers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants